import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import registerDirections from "./directives"; //自定义指令

import ElementPlus from "element-plus";
import "normalize.css"; //重置浏览器默认样式

import "@/style/element/css";
import "@/style/user-defined.css"; //自定义全局样式
import "@/style/element/index.css"; //自定义主题
import * as ElementPlusIconsVue from "@element-plus/icons-vue"; //引入elementUI-icon

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(ElementPlus); //注入elementUI，并进行国际化设置
app.use(store);
app.use(router);
app.use(registerDirections); //注入自定义指令

app.mount("#app");

//展示自定义变量，在.env.*中定义
//根据当前环境展示不同的预设值
console.log(
  "\n"
    .concat(
      ` %c 【${process.env.VUE_APP_NAME}】v ${process.env.VUE_APP_VERSION}`
    )
    .concat(` %c 接口地址:${process.env.VUE_APP_BASE_URL} \n`),
  "color: #fadfa3; background: #030307; padding:5px 0;",
  "background: #fadfa3; padding:5px 0;"
);
